package com.sunfeng.chap1;


import java.nio.CharBuffer;

public class Test3 {
    public static void main(String[] args) {
        char[] charArray = new char[]{'a', 'b', 'c', 'd'};
        CharBuffer charBuffer = CharBuffer.wrap(charArray);

        System.out.println(charBuffer.capacity());
        System.out.println(charBuffer.position());
        charBuffer.position(2);
        System.out.println(charBuffer.capacity());
        System.out.println(charBuffer.position());
        charBuffer.put('e');
        System.out.println("========");
        for (int i = 0; i <charArray.length ; i++) {
            System.out.println(charArray[i] + " ");
        }
    }
}
